/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.notaria.guerrasalas.be;

import gob.satt.comun.util.Util;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author Administrador
 */
@Embeddable
public class DetallePagoTicketPK implements Serializable {

    @Basic(optional = false)
    @Column(name = "FECHA_PAGO", nullable = false, insertable = true, updatable = true)
    @Temporal(TemporalType.TIMESTAMP)
    private Date fechaPago = new Date();
    @Basic(optional = false)
    @Column(name = "FID_TICKET", insertable = false, updatable = false)
    private Long idTicket;

    public DetallePagoTicketPK() {
    }

    public DetallePagoTicketPK(Long idTicket) {
        this.idTicket = idTicket;
    }

    public Date getFechaPago() {
        return fechaPago;
    }

    public void setFechaPago(Date fechaPago) {
        this.fechaPago = fechaPago;
    }

    public Long getIdTicket() {
        return idTicket;
    }

    public void setIdTicket(Long idTicket) {
        this.idTicket = idTicket;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final DetallePagoTicketPK other = (DetallePagoTicketPK) obj;
        if (this.fechaPago != other.fechaPago && (this.fechaPago == null || !this.fechaPago.equals(other.fechaPago))) {
            return false;
        }
        if (this.idTicket != other.idTicket && (this.idTicket == null || !this.idTicket.equals(other.idTicket))) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 23 * hash + (this.fechaPago != null ? this.fechaPago.hashCode() : 0);
        hash = 23 * hash + (this.idTicket != null ? this.idTicket.hashCode() : 0);
        return hash;
    }

    @Override
    public String toString() {
        return idTicket + ";" + Util.getFecha(fechaPago);
    }
}
